<template>
  <div class="child">
    <h4>我是Child</h4>
    <p>父组件的count值是{{ count }}</p>
    <button @click="$emit('changeMe', 1)">对count进行累加</button>
    <!-- 将父组件传递到Child的值和函数 除了用props接收的之外 全部传到深层次的子级组件 -->
    <GrandSon v-bind="$attrs" v-on="$listeners" />
  </div>
</template>

<script>
import GrandSon from "./GrandSon";
export default {
  name: "Props",
  props: ["count"],
  components: {
    GrandSon,
  },
  mounted() {
    // console.log(this.$attrs);
    // console.log(this.$listeners);
  },
};
</script>

<style scoped>

</style>
